<= Operator
Used to determine whether one alphabetic or quantitative expression is smaller than or equal to another. String comparisons are case-insensitive.
Syntax
result=expression1 <= expression2
Part | Type | Description |
result | Boolean | Returns True if expression1 is less than or equal to expression2. |
expression1 | String, Number, or Date | Any alphabetic or quantitative expression. |
expression2 | String, Number, or Date | Any alphabetic or quantitative expression. |
Notes
A string is "less than" another string if it is first when the two strings are sorted alphabetically. Use StrComp to do a case-sensitive String comparison.
You can use Operator_Compare to define comparisons for classes.
Examples
This example uses the <= operator to evaluate a and b.
Dim a,b as Integer
If Editfield1.text <> "" and EditField2.text <> "" then
a= Val(Editfield1.text)
b= Val(EditField2.text)
If a<=b then
MsgBox "A is less than or equal to B!"
else
Beep
end if
else
MsgBox "Please enter values into both boxes!"
end if
If Editfield1.text <> "" and EditField2.text <> "" then
a= Val(Editfield1.text)
b= Val(EditField2.text)
If a<=b then
MsgBox "A is less than or equal to B!"
else
Beep
end if
else
MsgBox "Please enter values into both boxes!"
end if
The following example tests whether a FolderItem is Nil before assigning it to the Movie property of a MoviePlayer control.
Dim f As FolderItem
f= GetOpenFolderItem("video/quicktime")
If f<> Nil then
MoviePlayer1.movie=f.OpenAsMovie
End if
f= GetOpenFolderItem("video/quicktime")
If f<> Nil then
MoviePlayer1.movie=f.OpenAsMovie
End if
See Also
>, >=, <, =, <>, and StrComp operators; Operator_Compare function.